package top.aigoo.project01.service;

import top.aigoo.project01.entity.LocalAuth;
import top.aigoo.project01.entity.dto.LocalAuthExecution;

/**
 * @Description: 请填写该类完成的功能
 * @Author: Mr.OYSHUO.欧阳大叔  mail:1642302522@qq.com
 * @Version 1.0.0
 * @Date: 2021/9/12 22:16
 */
public interface LocalAuthService {

    /**
     * 通过账号和密码获取平台账户信息
     *
     * @param userName
     * @param password
     * @return
     */
    LocalAuth getLocalAuthByUsernameAndPwd(String userName, String password);

    /**
     * 通过userId获取平台账户信息
     *
     * @param userId
     * @return
     */
    LocalAuth getLocalAuthByUserId(long userId);

    /**
     * 绑定微信,生成平台专属的账号
     *
     * @param localAuth
     * @return
     * @throws RuntimeException
     */
    LocalAuthExecution bindLocalAuth(LocalAuth localAuth) throws RuntimeException;

    /**
     * 修改平台账户的登录密码
     *
     * @param userId
     * @param userName
     * @param password
     * @param newPassword
     * @return
     */
    LocalAuthExecution modifyLocalAuth(Long userId,
                                       String userName,
                                       String password,
                                       String newPassword) throws RuntimeException;

}
